import java.util.Scanner;

public class Homework5 {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int[][] nums = new int[3][5];
		int[][] scores = new int[3][5];
		for (int i = 0; i < nums.length; i++) {
			for (int j = 0; j < nums[i].length; j++) {
				nums[i][j] = (int) (Math.random() * 100);
				System.out.print(nums[i][j] + "\t");
			}
		}
		System.out.println("\n*******************************************");
		int sum = 0;
		int sum1 = 0;
		int sum2 = 0;
		int sum3 = 0;
		int sum4 = 0;
		int sum5 = 0;
		int avg1 = 0;
		int avg2 = 0;
		int avg3 = 0;
		int avg4 = 0;
		int avg5 = 0;

		for (int i = 0; i < scores.length; i++) {
			sum = 0;
			System.out.println("输入第" + (i + 1) + "名同学的成绩");
			for (int j = 0; j < scores[i].length; j++) {
				switch (j) {
				case 0:
					System.out.println("Java:");
					break;
				case 1:
					System.out.println("Jsp:");
					break;
				case 2:
					System.out.println("CoreJava:");
					break;
				case 3:
					System.out.println("MySQL:");
					break;
				default:
					System.out.println("HTML5:");
					break;
				}

				scores[i][j] = input.nextInt();
				sum += scores[i][j];

			}
			System.out.println("总分：" + sum);
			System.out.println("******************************");

		}
		for (int i = 0; i < scores.length; i++) {
			for (int j = 0; j < 5; j++) {
				if (j == 0) {
					sum1 += scores[i][j];
				}
				if (j == 1) {
					sum2 += scores[i][j];
				}
				if (j == 2) {
					sum3 += scores[i][j];
				}
				if (j == 3) {
					sum4 += scores[i][j];
				}
				if (j == 4) {
					sum5 += scores[i][j];
				}
			}
		}
		avg1 = sum1 / 3;
		avg2 = sum2 / 3;
		avg3 = sum3 / 3;
		avg4 = sum4 / 3;
		avg5 = sum5 / 3;
		System.out.println("java的平均分为：" + avg1);
		System.out.println("JSP的平均分为：" + avg2);
		System.out.println("CoreJava的平均分为：" + avg3);
		System.out.println("MySQL：" + avg4);
		System.out.println("HTML5：" + avg5);

	}

}
